<?php defined('SYSPATH') or die('No direct script access.');

// Все, что не относится к другим контроллерам, пишем сюда.
class Controller_Admin_Main extends Controller_Admin_Base
{	
	public function action_index()
	{
        $counts['articles'] = $this->article_model->get_count_articles();
        $counts['comments'] = $this->article_comment_model->get_count_comments();
        $counts['categories'] = $this->category_model->get_count_categories();
        $counts['subcategories'] = $this->category_model->get_count_subcategories();
        
        $last_comments = $this->article_comment_model->get_last_comments(5);
        
        $title = 'Админпанель';
		$content = new View('admin/index_tpl');
        $content->counts = $counts;
        $content->last_comments = $last_comments; 
        $content->user   = $this->user;
        
        $menu = array(
            'menu' => 1,
            'submenu' => 0
        );
		
		$this->print_template($title, $content, $menu);
	}
} // End Admin_Main
